home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Nov 25 1998
- //
- // Description:
- // Supports context sensitive menu items.
- //
- // Procs:
- // addContextHelpProc()
- // removeContextHelpProc()
- // doContextHelpProc()
- // hasContextHelpProc()
- //
-
- global proc addContextHelpProc(string $object, string $procName)
- //
- // Description:
- // addContextHelpProc - creates an array of maps
- // from the window or panel name to the
- // procedure that is responsible to display
- // context sensitive help.
- //
- // Arguments:
- // $object - is the name of the panel or window.
- // $procName - then name of the procedure that calls
- // window or panel specific context sensitive help.
- //
- {
- global string $gHelpObjectArray[];
- global string $gHelpProcNameArray[];
-
- int $i;
- int $present;
- int $numItems = size($gHelpObjectArray);
-
- for ($i = 0; $i < $numItems; $i++)
- {
- if ($gHelpObjectArray[$i] == $object)
- {
- $present = true;
- break;
- }
- }
-
- if (!$present)
- {
- $gHelpObjectArray[$numItems] = $object;
- $gHelpProcNameArray[$numItems] = $procName;
- }
- }
-
- global proc removeContextHelpProc(string $object)
- //
- // Description:
- // removeContextHelpProc - removes the specified map
- // from the array. Main usage is for plugins.
- //
- // Arguments:
- // $object - is the name of the panel or window.
- //
- {
- global string $gHelpObjectArray[];
- global string $gHelpProcNameArray[];
-
- int $i;
- int $numItems = size($gHelpObjectArray);
-
- for ($i = 0; $i < $numItems; $i++)
- {
- if ($gHelpObjectArray[$i] == $object)
- {
- // When context sensitive help is removed
- // for now it will be replaced by "xxxx"
- // in the array to suggest removal.
- // Later, it could be modified to properly remove the item.
- //
- $gHelpObjectArray[$i] = "xxxx";
- $gHelpProcNameArray[$i] = "xxxx";
- break;
- }
- }
- }
-
-
- global proc doContextHelpProc(string $object, string $menuParent)
- //
- // Description:
- // doContextHelpProc - given the window or panel name
- // it finds the corresponding procedure and calls
- // the menu's context sensitive help.
- //
- // Arguments:
- // $object - is the name of the panel or window.
- // $menuParent - the parent of the menu.
- //
- {
- global string $gHelpObjectArray[];
- global string $gHelpProcNameArray[];
-
- if ($object != "" && $menuParent != "")
- {
- int $i;
- int $numItems = size($gHelpObjectArray);
-
- for ($i = 0; $i < $numItems; $i++)
- {
- if ($gHelpObjectArray[$i] == $object)
- {
- eval ($gHelpProcNameArray[$i] + " " + $object + " " + $menuParent);
- break;
- }//if
- }//for
- }//if
- }
-
- global proc int hasContextHelpProc(string $object)
- //
- // Description:
- // hasContextHelpProc - given the window or panel name
- // it checks if context help exists for that specific
- // window or panel.
- //
- // Arguments:
- // $object - is the name of the panel or window.
- //
- {
- int $contextHelpExists = false;
-
- global string $gHelpObjectArray[];
- global string $gHelpProcNameArray[];
-
- int $i;
- int $numItems = size($gHelpObjectArray);
-
- for ($i = 0; $i < $numItems; $i++)
- {
- if ($gHelpObjectArray[$i] == $object)
- {
- $contextHelpExists = true;
- break;
- }//if
- }//for
-
- return $contextHelpExists;
- }
-
-